package com.learning.java.optimize.design.pattern.observer.listener;

import com.learning.java.optimize.design.pattern.observer.InsuranceAcceptanceEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * ClassName: MessageListener
 * Description: 短信发送监听
 * Date: 2020/3/22 8:48 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Slf4j
@Component
public class MessageListener implements ApplicationListener<InsuranceAcceptanceEvent> {
    @Override
    public void onApplicationEvent(InsuranceAcceptanceEvent event) {
        log.info("2. 短信通知，调用短信发送接口 -> XXX，您购买的XXX承保成功");
    }
}
